class RoomsController < ApplicationController
  layout nil
  include ApplicationHelper


  def index
#    ldap = Net::LDAP.new({
#        :host =>  'ldap.rutgers.edu',
#        :port => 389,
#        :auth=> {
#          :method=> :anonymous
#        }
#      })
#    ldap.search( :base => "uid=hedrick,ou=People,dc=rutgers,dc=edu") do |entry|
#      raise entry.inspect
#    end

    ldap = Net::LDAP.new({
        :host =>  'oscar.wvrgroup.internal',
        :port => 389,
        :auth=> {
          :method=> :simple,
          :username => "gshelke",
          :password => "fifa2010"
        }
      })
#    filter = Net::LDAP::Filter.eq( 'objectCategory', 'person' ) & Net::LDAP::Filter.eq( 'sAMAccountName', '101183')
#    ldap.search( :base => "dn=101183", :filter => filter) do |entry|
#      raise entry.inspect
#    end

#    ldap = Net::LDAP.new
#ldap.host = 'ldap.rutgers.edu'
#ldap.auth "uid=hedrick,ou=people,dc=rutgers,dc=edu", "yyyy"

    if ldap.bind
      raise "ok"
    else
      raise "not ok"
    end
    raise "ldap"
  end
end